﻿using MongoDB.Driver;

namespace MongoDAO.Providers
{
    public class MongoServerProvider
    {
        private readonly string _connectionString;
        private readonly MongoClient _client;
        private readonly MongoServer _server;

        public MongoServerProvider(string connectionString)
        {
            _connectionString = connectionString;
            _client = new MongoClient(_connectionString);
            _server = _client.GetServer();
        }

        public MongoServer GetServer()
        {
            return _server;
        }

        public MongoClient GetClient()
        {
            return _client;
        }

        public string GetConnectionString()
        {
            return _connectionString;
        }
    }
}
